<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>系统首页</title>
    <link rel="stylesheet" href="{$CSS}/bootstrap3.3.7.min.css">
    <style>
        em{
            font-size: 20px;
            color: red;
            vertical-align: middle;
            line-height: 20px;
            height: 20px;
            display: inline-block;
        }
        .mar{
            margin-right:10px
        }
        .pic{
        	float:none;margin-bottom:10px
        }
        .pic img{
        	width: 393px;
    		height: 75px;
    	}
    </style>
</head>
<body style="overflow-x:hidden;">
    <div style="padding:10px;border-bottom:1px solid #eee;font-size:15px;font-weight:700">添加客户&nbsp;&nbsp;[<a href="zuizhongliebiao.html">客户管理</a>]</div>
    <div style="margin:40px auto;">
        <div class="bs-example" data-example-id="simple-horizontal-form">
            <form class="form-horizontal" method="post" action="" name="clientForm" id="regform">{tk()}{$user->hidden('id')}
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>账号</label>
                    <div class="col-sm-3">
						<!-- {if $user->has_id()}
						{$user->un}
						{else}
						{$user->text('un','class="form-control"  placeholder="账号"')}
						{/if} -->
                        {$user->text('un','class="form-control"  placeholder="账号"')}
						<span class="help-inline"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>密码</label>
                    <div class="col-sm-3">
                        <!-- {$user->password('pwd','class="form-control" placeholder="密码"')} -->
                        <input type="password" class="form-control" value="" placeholder="留空默认不修改密码" name="pwd">
						<span class="help-inline"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">客户经理</label>
                    <div class="col-sm-3">
						{$user->text('jingli','class="form-control" placeholder="客户经理"')}
                    </div>
                </div>
				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>联系人</label>
                    <div class="col-sm-3">
						{$user->text('lxr','class="form-control" placeholder="联系人"')}
						<span class="help-inline"></span>
                    </div>
                </div>

				<div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label"><em>*</em>手机号</label>
                    <div class="col-sm-3">
						{$user->text('telephone','class="form-control" placeholder="手机号"')}
						<span class="help-inline"></span>
                    </div>
                </div>

                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">备注</label>
                    <div class="col-sm-3">
                        {$user->text('alias','class="form-control" placeholder="备注"')}
                        <span class="help-inline"></span>
                    </div>
                </div>


				{if $mu->isadmin}
				 <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">所属业务(代理)</label>
                    <div class="col-sm-2">					
						{$user->select($yw,'agid','class="form-control"')}
                    </div>
                </div>

				{/if}
				{if $display}	
				{/if}
				
                <div class="form-group">
                   <label for="inputPassword3" class="col-sm-2 control-label"></label>
                    <div class="col-sm-6">
						<input class="btn btn-success mar" type="hidden" name="action" value="add" />
                        <input class="btn btn-success mar" name="btnAdd" ID="btnAdd" onclick="registerUser()" type="button" class="button" value="提交">
                        <input class="btn btn-warning mar" name="reset" ID="Submit1" type="reset" value="重置">
                        <input class="btn btn-danger mar"  name="back" ID="back" type="button" onclick="history.back();" value="返回">
                        </div>
                </div>
				
            </form>
        </div>

    </div>
</body>

</html>
<script type="text/javascript">
	
	function registerUser(){  
		$('.help-inline').remove();
		$('.maroon').css('display','none')
		$('#regform').validate(function(m){
		    if(m.length>0){
		        for(var i=0;i<m.length;i++){
		            //m[i].e为验证错误的表单元素
		            //m[i].m该单元的错误信息（非空错误为false，其他为信息数组）
		 			var ntip = $('<span class="help-inline" style="color:red">'+(m[i].m===false?'该项内容不能为空':m[i].m.join(','))+'</span>');
		            $(m[i].e).after(ntip.show());
		            $(m[i].e).one('blur',function(){
		            	ntip.remove();
		            });
		        }
		    }else{
		        $('form').submit();
		    }
		});
	}
</script>